package com.shuaitao.newsystem.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.sun.istack.internal.NotNull;
import lombok.Data;

/**
 *
 * @TableName news
 */
@TableName(value ="news")
@Data
public class News implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Integer nid;

    /**
     *
     */
    private Integer ntid;

    /**
     *
     */

    private String ntitle;

    @NotNull
    private String nauthor;

    /**
     *
     */
    private Date ncreatedate;

    /**
     *
     */
    private String npicpath;

    /**
     *
     */
    private String ncontent;

    /**
     *
     */
    private Date nmodifydate;

    /**
     *
     */
    private String nsummary;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        News other = (News) that;
        return (this.getNid() == null ? other.getNid() == null : this.getNid().equals(other.getNid()))
            && (this.getNtid() == null ? other.getNtid() == null : this.getNtid().equals(other.getNtid()))
            && (this.getNtitle() == null ? other.getNtitle() == null : this.getNtitle().equals(other.getNtitle()))
            && (this.getNauthor() == null ? other.getNauthor() == null : this.getNauthor().equals(other.getNauthor()))
            && (this.getNcreatedate() == null ? other.getNcreatedate() == null : this.getNcreatedate().equals(other.getNcreatedate()))
            && (this.getNpicpath() == null ? other.getNpicpath() == null : this.getNpicpath().equals(other.getNpicpath()))
            && (this.getNcontent() == null ? other.getNcontent() == null : this.getNcontent().equals(other.getNcontent()))
            && (this.getNmodifydate() == null ? other.getNmodifydate() == null : this.getNmodifydate().equals(other.getNmodifydate()))
            && (this.getNsummary() == null ? other.getNsummary() == null : this.getNsummary().equals(other.getNsummary()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getNid() == null) ? 0 : getNid().hashCode());
        result = prime * result + ((getNtid() == null) ? 0 : getNtid().hashCode());
        result = prime * result + ((getNtitle() == null) ? 0 : getNtitle().hashCode());
        result = prime * result + ((getNauthor() == null) ? 0 : getNauthor().hashCode());
        result = prime * result + ((getNcreatedate() == null) ? 0 : getNcreatedate().hashCode());
        result = prime * result + ((getNpicpath() == null) ? 0 : getNpicpath().hashCode());
        result = prime * result + ((getNcontent() == null) ? 0 : getNcontent().hashCode());
        result = prime * result + ((getNmodifydate() == null) ? 0 : getNmodifydate().hashCode());
        result = prime * result + ((getNsummary() == null) ? 0 : getNsummary().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", nid=").append(nid);
        sb.append(", ntid=").append(ntid);
        sb.append(", ntitle=").append(ntitle);
        sb.append(", nauthor=").append(nauthor);
        sb.append(", ncreatedate=").append(ncreatedate);
        sb.append(", npicpath=").append(npicpath);
        sb.append(", ncontent=").append(ncontent);
        sb.append(", nmodifydate=").append(nmodifydate);
        sb.append(", nsummary=").append(nsummary);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
